3.397 \(\int x \cos (2 x) \sec ^3(x) \, dx\)

Optimal. Leaf size=67 \[ \frac{3}{2} i \text{PolyLog}\left (2,-i e^{i x}\right )-\frac{3}{2} i \text{PolyLog}\left (2,i e^{i x}\right )-3 i x \tan ^{-1}\left (e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \tan (x) \sec (x) \]

[Out]

(-3*I)*x*ArcTan[E^(I*x)] + ((3*I)/2)*PolyLog[2, (-I)*E^(I*x)] - ((3*I)/2)*PolyLog[2, I*E^(I*x)] + Sec[x]/2 - (
x*Sec[x]*Tan[x])/2

________________________________________________________________________________________

Rubi [A]  time = 0.137247, antiderivative size = 67, normalized size of antiderivative = 1., number of steps used = 19, number of rules used = 6, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.6, Rules used = {4431, 4181, 2279, 2391, 4413, 4185} \[ \frac{3}{2} i \text{PolyLog}\left (2,-i e^{i x}\right )-\frac{3}{2} i \text{PolyLog}\left (2,i e^{i x}\right )-3 i x \tan ^{-1}\left (e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \tan (x) \sec (x) \]

Antiderivative was successfully verified.

[In]

Int[x*Cos[2*x]*Sec[x]^3,x]

[Out]

(-3*I)*x*ArcTan[E^(I*x)] + ((3*I)/2)*PolyLog[2, (-I)*E^(I*x)] - ((3*I)/2)*PolyLog[2, I*E^(I*x)] + Sec[x]/2 - (
x*Sec[x]*Tan[x])/2

Rule 4431

Int[((e_.) + (f_.)*(x_))^(m_.)*(F_)[(a_.) + (b_.)*(x_)]^(p_.)*(G_)[(c_.) + (d_.)*(x_)]^(q_.), x_Symbol] :> Int
[ExpandTrigExpand[(e + f*x)^m*G[c + d*x]^q, F, c + d*x, p, b/d, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && M
emberQ[{Sin, Cos}, F] && MemberQ[{Sec, Csc}, G] && IGtQ[p, 0] && IGtQ[q, 0] && EqQ[b*c - a*d, 0] && IGtQ[b/d,
1]

Rule 4181

Int[csc[(e_.) + Pi*(k_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-2*(c + d*x)^m*ArcTanh[E
^(I*k*Pi)*E^(I*(e + f*x))])/f, x] + (-Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Log[1 - E^(I*k*Pi)*E^(I*(e + f*x))],
 x], x] + Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Log[1 + E^(I*k*Pi)*E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e,
f}, x] && IntegerQ[2*k] && IGtQ[m, 0]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 4413

Int[((c_.) + (d_.)*(x_))^(m_.)*Sec[(a_.) + (b_.)*(x_)]*Tan[(a_.) + (b_.)*(x_)]^(p_), x_Symbol] :> -Int[(c + d*
x)^m*Sec[a + b*x]*Tan[a + b*x]^(p - 2), x] + Int[(c + d*x)^m*Sec[a + b*x]^3*Tan[a + b*x]^(p - 2), x] /; FreeQ[
{a, b, c, d, m}, x] && IGtQ[p/2, 0]

Rule 4185

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_)), x_Symbol] :> -Simp[(b^2*(c + d*x)*Cot[e + f*x]*
(b*Csc[e + f*x])^(n - 2))/(f*(n - 1)), x] + (Dist[(b^2*(n - 2))/(n - 1), Int[(c + d*x)*(b*Csc[e + f*x])^(n - 2
), x], x] - Simp[(b^2*d*(b*Csc[e + f*x])^(n - 2))/(f^2*(n - 1)*(n - 2)), x]) /; FreeQ[{b, c, d, e, f}, x] && G
tQ[n, 1] && NeQ[n, 2]

Rubi steps

\begin{align*} \int x \cos (2 x) \sec ^3(x) \, dx &=\int \left (x \sec (x)-x \sec (x) \tan ^2(x)\right ) \, dx\\ &=\int x \sec (x) \, dx-\int x \sec (x) \tan ^2(x) \, dx\\ &=-2 i x \tan ^{-1}\left (e^{i x}\right )-\int \log \left (1-i e^{i x}\right ) \, dx+\int \log \left (1+i e^{i x}\right ) \, dx+\int x \sec (x) \, dx-\int x \sec ^3(x) \, dx\\ &=-4 i x \tan ^{-1}\left (e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \sec (x) \tan (x)+i \operatorname{Subst}\left (\int \frac{\log (1-i x)}{x} \, dx,x,e^{i x}\right )-i \operatorname{Subst}\left (\int \frac{\log (1+i x)}{x} \, dx,x,e^{i x}\right )-\frac{1}{2} \int x \sec (x) \, dx-\int \log \left (1-i e^{i x}\right ) \, dx+\int \log \left (1+i e^{i x}\right ) \, dx\\ &=-3 i x \tan ^{-1}\left (e^{i x}\right )+i \text{Li}_2\left (-i e^{i x}\right )-i \text{Li}_2\left (i e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \sec (x) \tan (x)+i \operatorname{Subst}\left (\int \frac{\log (1-i x)}{x} \, dx,x,e^{i x}\right )-i \operatorname{Subst}\left (\int \frac{\log (1+i x)}{x} \, dx,x,e^{i x}\right )+\frac{1}{2} \int \log \left (1-i e^{i x}\right ) \, dx-\frac{1}{2} \int \log \left (1+i e^{i x}\right ) \, dx\\ &=-3 i x \tan ^{-1}\left (e^{i x}\right )+2 i \text{Li}_2\left (-i e^{i x}\right )-2 i \text{Li}_2\left (i e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \sec (x) \tan (x)-\frac{1}{2} i \operatorname{Subst}\left (\int \frac{\log (1-i x)}{x} \, dx,x,e^{i x}\right )+\frac{1}{2} i \operatorname{Subst}\left (\int \frac{\log (1+i x)}{x} \, dx,x,e^{i x}\right )\\ &=-3 i x \tan ^{-1}\left (e^{i x}\right )+\frac{3}{2} i \text{Li}_2\left (-i e^{i x}\right )-\frac{3}{2} i \text{Li}_2\left (i e^{i x}\right )+\frac{\sec (x)}{2}-\frac{1}{2} x \sec (x) \tan (x)\\ \end{align*}

Mathematica [B]  time = 0.27406, size = 146, normalized size = 2.18 \[ \frac{1}{4} \left (6 i \text{PolyLog}\left (2,-i e^{i x}\right )-6 i \text{PolyLog}\left (2,i e^{i x}\right )+6 x \log \left (1-i e^{i x}\right )-6 x \log \left (1+i e^{i x}\right )+\frac{x}{\sin (x)-1}+\frac{x}{\left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )^2}+\frac{2 \sin \left (\frac{x}{2}\right )}{\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )}-\frac{2 \sin \left (\frac{x}{2}\right )}{\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Cos[2*x]*Sec[x]^3,x]

[Out]

(6*x*Log[1 - I*E^(I*x)] - 6*x*Log[1 + I*E^(I*x)] + (6*I)*PolyLog[2, (-I)*E^(I*x)] - (6*I)*PolyLog[2, I*E^(I*x)
] + (2*Sin[x/2])/(Cos[x/2] - Sin[x/2]) + x/(Cos[x/2] + Sin[x/2])^2 - (2*Sin[x/2])/(Cos[x/2] + Sin[x/2]) + x/(-
1 + Sin[x]))/4

________________________________________________________________________________________

Maple [B]  time = 0.223, size = 102, normalized size = 1.5 \begin{align*}{\frac{i \left ( x{{\rm e}^{3\,ix}}-x{{\rm e}^{ix}}-i{{\rm e}^{3\,ix}}-i{{\rm e}^{ix}} \right ) }{ \left ({{\rm e}^{2\,ix}}+1 \right ) ^{2}}}-{\frac{3\,x\ln \left ( 1+i{{\rm e}^{ix}} \right ) }{2}}+{\frac{3\,x\ln \left ( 1-i{{\rm e}^{ix}} \right ) }{2}}+{\frac{3\,i}{2}}{\it dilog} \left ( 1+i{{\rm e}^{ix}} \right ) -{\frac{3\,i}{2}}{\it dilog} \left ( 1-i{{\rm e}^{ix}} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*cos(2*x)*sec(x)^3,x)

[Out]

I/(exp(2*I*x)+1)^2*(x*exp(3*I*x)-x*exp(I*x)-I*exp(3*I*x)-I*exp(I*x))-3/2*x*ln(1+I*exp(I*x))+3/2*x*ln(1-I*exp(I
*x))+3/2*I*dilog(1+I*exp(I*x))-3/2*I*dilog(1-I*exp(I*x))

________________________________________________________________________________________

Maxima [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(2*x)*sec(x)^3,x, algorithm="maxima")

[Out]

Timed out

________________________________________________________________________________________

Fricas [B]  time = 0.538735, size = 500, normalized size = 7.46 \begin{align*} \frac{3 \, x \cos \left (x\right )^{2} \log \left (i \, \cos \left (x\right ) + \sin \left (x\right ) + 1\right ) - 3 \, x \cos \left (x\right )^{2} \log \left (i \, \cos \left (x\right ) - \sin \left (x\right ) + 1\right ) + 3 \, x \cos \left (x\right )^{2} \log \left (-i \, \cos \left (x\right ) + \sin \left (x\right ) + 1\right ) - 3 \, x \cos \left (x\right )^{2} \log \left (-i \, \cos \left (x\right ) - \sin \left (x\right ) + 1\right ) - 3 i \, \cos \left (x\right )^{2}{\rm Li}_2\left (i \, \cos \left (x\right ) + \sin \left (x\right )\right ) - 3 i \, \cos \left (x\right )^{2}{\rm Li}_2\left (i \, \cos \left (x\right ) - \sin \left (x\right )\right ) + 3 i \, \cos \left (x\right )^{2}{\rm Li}_2\left (-i \, \cos \left (x\right ) + \sin \left (x\right )\right ) + 3 i \, \cos \left (x\right )^{2}{\rm Li}_2\left (-i \, \cos \left (x\right ) - \sin \left (x\right )\right ) - 2 \, x \sin \left (x\right ) + 2 \, \cos \left (x\right )}{4 \, \cos \left (x\right )^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(2*x)*sec(x)^3,x, algorithm="fricas")

[Out]

1/4*(3*x*cos(x)^2*log(I*cos(x) + sin(x) + 1) - 3*x*cos(x)^2*log(I*cos(x) - sin(x) + 1) + 3*x*cos(x)^2*log(-I*c
os(x) + sin(x) + 1) - 3*x*cos(x)^2*log(-I*cos(x) - sin(x) + 1) - 3*I*cos(x)^2*dilog(I*cos(x) + sin(x)) - 3*I*c
os(x)^2*dilog(I*cos(x) - sin(x)) + 3*I*cos(x)^2*dilog(-I*cos(x) + sin(x)) + 3*I*cos(x)^2*dilog(-I*cos(x) - sin
(x)) - 2*x*sin(x) + 2*cos(x))/cos(x)^2

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(2*x)*sec(x)**3,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x \cos \left (2 \, x\right ) \sec \left (x\right )^{3}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(2*x)*sec(x)^3,x, algorithm="giac")

[Out]

integrate(x*cos(2*x)*sec(x)^3, x)